import type { VabRouteRecord } from '/#/router'
import Layout from '@vab/layouts/index.vue'

export const storeRouter: VabRouteRecord = {
  path: '/store',
  name: 'store',
  component: Layout,
  meta: {
    title: '店铺管理',
    icon: 'blaze-fill',
    guard: {
      //2021年9月份新版本，当config/settings.js中rolesControl配置开启时，用于控制角色（全写）
      role: ['storeListView','storeInfoApprove'],
      mode: 'oneOf', //allOf: 数组内所有角色都拥有，返回True oneOf: 数组内拥有任一角色，返回True(等价第1种数据) except: 不拥有数组内任一角色，返回True(取反)
    },
  },
  children: [
    {
      path: 'storeList',
      name: 'storeList',
      component: () => import('@/views/store/storeList.vue'),
      meta: {
        title: '店铺审核管理',
        guard: {
          role: ['storeListView'],
        },
      },
    },
    {
      path: 'storeInfoApprove',
      name: 'storeInfoApprove',
      component: () => import('@/views/store/storeInfoApprove.vue'),
      meta: {
        title: '店铺审核',
        hidden: true,
        tabHidden: true,
        guard: {
          role: ['storeInfoApprove'],
        },
      },
    },
  ],
}
